<?php

// классы-фейки
class RssDownload {
	public function isSuccessGet() { return true; }
	public function getURL() {return "";}
	public function getFeedOid() { return 1;}
	public function upState() {}
}

class fobject {
	public function save() {}
	public function updateSense() {}
	}

class Model_RssDLQueue {
	public function getQueue() {
		$rss_ser_fn = "utest/rss_queue";
		$handle = fopen($rss_ser_fn, "rb");
		$contents = fread($handle, filesize($rss_ser_fn));
		fclose($handle);
		return unserialize($contents);		
	}
}

class MagpieRSS {
	public $items;
	}

class RssLibWrapper {
	private $counter = 0;
	public function fetch() {
		$rss_ser_fn = "utest/rss_serialize";
		$handle = fopen($rss_ser_fn, "rb");
		$contents = fread($handle, filesize($rss_ser_fn));
		fclose($handle);
		return unserialize($contents);
	}
	public function makeRssItem($item) {
		$this->counter++;
		$rss_ser_fn = "utest/rss_item";
		$handle = fopen($rss_ser_fn, "rb");
		$contents = fread($handle, filesize($rss_ser_fn));
		fclose($handle);
		$item = unserialize($contents);
		$item->title = $this->counter; 
		return $item;
	}
	
	public function resetCounter() {$this->counter = 0;}
}

